<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.text.*" %>




<%@ page import="net.sf.json.JSONArray" %>
<%@ page import="net.sf.json.JSONArray" %>
<%@ page import="net.sf.json.JSONArray" %>
<%@ page import="net.sf.json.JSONObject" %>
<%@ page import="java.util.regex.Pattern" %>
<%@ page import="java.util.regex.Matcher" %>
<%!
    public final static HashMap getDesc(String introduce) {
        HashMap resultMap = new HashMap();
        String pzInfo = "";
        String trial = "";
        String noTrial = "";
        String copyRight = "";
        String freeTag = "";

        //截取计费配置
        if (introduce.indexOf("【VIP") > -1) {
            Pattern vipIInfoP = Pattern.compile("【VIP.+?】");
            Matcher vipIInfoM = vipIInfoP.matcher(introduce);
            if (vipIInfoM.find()) {
                pzInfo = vipIInfoM.group(0);
                introduce = introduce.replace(pzInfo, "");
            }
            if("".equals(introduce)){
                introduce = "暂无内容";
            }
        }

        //试看标识截取
        if (introduce.indexOf("【trial") > -1) {
            Pattern vipTrialP = Pattern.compile("【trial】");
            Matcher vipTrialM = vipTrialP.matcher(introduce);
            if (vipTrialM.find()) {
                trial = vipTrialM.group(0);
                introduce = introduce.replace(trial, "");
            }
            if("".equals(introduce)){
                introduce = "暂无内容";
            }
        }

        //不可试看标识截取
        if (introduce.indexOf("【notrial") > -1) {
            Pattern vipNoTrialP = Pattern.compile("【notrial】");
            Matcher vipNoTrialM = vipNoTrialP.matcher(introduce);
            if (vipNoTrialM.find()) {
                noTrial = vipNoTrialM.group(0);
                introduce = introduce.replace(noTrial, "");
            }
            if("".equals(introduce)){
                introduce = "暂无内容";
            }
        }

        //版权来源标识截取
        if (introduce.indexOf("【Copyright") > -1) {
            Pattern vipCopyrightP = Pattern.compile("【Copyright.+?】");
            Matcher vipCopyrightM = vipCopyrightP.matcher(introduce);
            if (vipCopyrightM.find()) {
                copyRight = vipCopyrightM.group(0);
                introduce = introduce.replace(copyRight, "");
            }
            if("".equals(introduce)){
                introduce = "暂无内容";
            }
        }

        //FREE标识截取
        if (introduce.indexOf("【FREE") > -1) {
            Pattern subr = Pattern.compile("【FREE.+?】");
            Matcher subm = subr.matcher(introduce);
            if (subm.find()) {
                freeTag = subm.group(0);
                introduce = introduce.replace(freeTag, "");
                freeTag = freeTag.replace("【FREE", "").replace("】", "");
            }
        }

        resultMap.put("vipInfo", pzInfo);
        resultMap.put("trial", trial);
        resultMap.put("noTrial", noTrial);
        resultMap.put("copyRight", copyRight);
        resultMap.put("freeTag", freeTag);
        resultMap.put("introduce", introduce);

        return resultMap;
    }
%>
